package com.fbty.mt.action.admin;

import com.fbty.base.action.BaseAction;
import com.fbty.base.domain.Page;
import com.fbty.mt.domain.Item;
import com.fbty.mt.service.ItemService;

public class ItemManagerAction extends BaseAction {
	
	private ItemService itemService;
	
	private Page page;
	
	private int pageNo=1;
	
	private int pageSize=20;
	
	private Integer flag=0;
	
	private int id;
	
	private double price;
	
	public String show(){
		page = itemService.queryItems(pageNo, pageSize, flag);
		return "show";
	}

	public String sureModify(){
		itemService.updateSure(id,request.getSession());
		return "sureModify";
	}
	
	public String update(){
		Item item = itemService.finItemById(id);
		
		item.setPrice(price);
		itemService.updateItem(item);
		
		return "update";
		
	}
	public String delete(){
		itemService.deleteItem(id);
		return "delete";
		
	}
	
	public void setItemService(ItemService itemService) {
		this.itemService = itemService;
	}


	public Page getPage() {
		return page;
	}


	public void setPage(Page page) {
		this.page = page;
	}


	public int getPageNo() {
		return pageNo;
	}


	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}


	public int getPageSize() {
		return pageSize;
	}


	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}


	public Integer getFlag() {
		return flag;
	}
	
	
	public void setFlag(Integer flag) {
		this.flag = flag;
	}


	public int getId() {
		return id;
	}


	public void setId(int id) {
		this.id = id;
	}


	public double getPrice() {
		return price;
	}


	public void setPrice(double price) {
		this.price = price;
	}
	
	
}
